import React from 'react';
import { connect } from 'react-redux';
import { BROWSER_MODE } from 'Constants/webConstants';
import './index.scss';


class FlagTitle extends React.PureComponent {
  constructor(props) {
    super(props);
    this.state = {};
  }

  render() {
    const { mode } = this.props;
    const isVertical = BROWSER_MODE.isVertical(mode);
    if (isVertical) {
      return (
        <div className={`v-flag-title ${this.props.className}`}>
          {
            this.props.text || ''
          }
        </div>
      );
    }
    return (
      <div className="flag-title">
        {
          this.props.text || ''
        }
      </div>
    );
  }
}

function mapStateToProps(state) {
  return {
    ...state.webReducer
  };
}

export default connect(mapStateToProps)(FlagTitle);
